package com.zhou.message.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zhou.message.dao.SendMessage;
import com.zhou.message.mapper.SendMessageMapper;
import com.zhou.message.service.SendMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lang.zhou
 * @since 2023-03-01
 */
@Service
public class SendMessageServiceImpl extends ServiceImpl<SendMessageMapper, SendMessage> implements SendMessageService {

    @Override
    public void deleteSendMessageFalse(Collection<Long> idList) {
        //update sys_send_message set delete_flag = 1 where id = #{id}
        LambdaUpdateWrapper<SendMessage> w = new LambdaUpdateWrapper<>();
        w.in(SendMessage::getId,idList);
        w.set(SendMessage::getDeleteFlag,1);
        update(w);
    }
}
